package com.tangyuan.live.controller;

import com.tangyuan.common.result.Result;
import com.tangyuan.common.result.ResultCodeEnum;
import com.tangyuan.live.entity.dto.ManagementDto;
import com.tangyuan.live.service.LiveManagementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@RestController
@RequestMapping("live/management")
public class LiveManagementController {

    @Autowired
    LiveManagementService liveManagementService;


    /**
     * 移出用户
     * @param userId 操作人
     * @param dto 操作参数
     * @return ResultCodeEnum
     */
    @PostMapping("shiftOutUser")
    public Result<ResultCodeEnum> liveManagement(@RequestHeader Long userId , @RequestBody @Valid ManagementDto dto){
        return liveManagementService.shiftOutUser(userId,dto);
    }

    /**
     * 禁言用户
     * @param userId 操作人
     * @param dto 操作参数
     * @return ResultCodeEnum
     */
    @PostMapping("shutUpUser")
    public Result<ResultCodeEnum> shutUpUser(@RequestHeader Long userId , @RequestBody @Valid ManagementDto dto){
        return liveManagementService.shutUpUser(userId,dto);
    }

}
